The present disclosure relates to processing in a computer system; more specifically the present disclosure relates to a method for safely interrupting blocked work in a server.
Computer systems typically include a combination of hardware (e.g., semiconductors, circuit boards, etc.) and software (e.g., computer programs). As advances in semiconductor processing and computer architecture push the performance of the computer hardware higher, more sophisticated computer software has evolved to take advantage of the higher performance of the hardware, resulting in computer systems today that are much more powerful than just a few years ago.
Computer systems typically include operating system software that controls the basic function of the computer, and one or more software application programs that run under the control of the operating system to perform desired tasks. For example, a typical IBM Personal Computer may run the OS/2 operating system, and under the control of the OS/2 operating system, a user may execute an application program, such as a word processor. As the capabilities of computers have increased, the application programs designed for high performance computer systems have become extremely powerful.
Depending on the allocation of shared system resources among different processes, conflicts in resource utilization can occur. Since many different processes can be processing simultaneously, it is entirely possible that two or more of the processes may need access to a given shared system resource at the same time. However, if a given processes has acquired a resource for use and that processes is terminated unexpectedly for any reason, the acquired resource may become unavailable for other processes, leading to inefficiencies in the processing environment.
For example, a given process running on a thread may be using a shared system resource such as a mutex object. A mutex object is an object that locks a piece of data such that only one thread can control that piece of data at any time. It is a shared system resource because many threads may wish to access the mutex object to get to the piece of data. If the thread is terminated abruptly, such that the thread does not have an opportunity to quiesce its state, the shared mutex object may be “locked-out” and other threads associated with other processes may be unable to access the mutex object, and its concomitant data, for use. This situation may require a complete shutdown of one or more processes to allow the shared resource to be “released” so that the shared resource can be made available for other processes. In another scenario, a process may be “looping” for an extended period of time, using a shared system resource, and thereby preventing other system processes from accessing the shared system resource. In some cases, it may even become necessary to restart the entire system to allow the shared resource to become available for processing again.
Such blocked work can prevent the server from processing other requests and perhaps eventually completely seize up if all dispatch threads become blocked. The current solution in use to this problem is to wait a specified amount of time for a request to complete and if it does not complete within that time to terminate the server process. This has the unfortunate side effect of also terminating any other requests being dispatched in the application server.
Therefore, what is needed is a shared system resource allocation and management mechanism for effectively allocating and controlling shared system resources.